package com.webside.playbackstatistics.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.webside.base.baseservice.impl.AbstractService;
import com.webside.playbackstatistics.mapper.AnaDailyStatMapper;
import com.webside.playbackstatistics.model.AnaDailyStatEntity;
import com.webside.playbackstatistics.service.AnaDailyStatService;
import com.webside.resource.model.ResourceEntity;

@Service("AnaDailyStatService")
public class AnaDailyStatServiceImpl extends AbstractService<ResourceEntity, Long> implements AnaDailyStatService {
	@Autowired
	private AnaDailyStatMapper anaDailyStatMapper;

	// 这句必须要加上。不然会报空指针异常，因为在实际调用的时候不是BaseMapper调用，而是具体的mapper，这里为userMapper
	@Autowired
	public void setBaseMapper() {
		super.setBaseMapper(anaDailyStatMapper);
	}

	// 统计平台昨日点播总次数、视频播放总时长、评论数、点赞数、分享数信息。
	@Override
	public AnaDailyStatEntity yesterdayStat(String yesterday) {
		// TODO Auto-generated method stub
		return anaDailyStatMapper.yesterdayStat(yesterday);	}
	// 将每日的统计数据存储起来
	@Override
	public int addAnaDailyStat(AnaDailyStatEntity anaDailyStatEntity) {
		// TODO Auto-generated method stub
		return anaDailyStatMapper.addAnaDailyStat(anaDailyStatEntity);
	}

	@Override
	public AnaDailyStatEntity avgAnaDailyStat() {
		// TODO Auto-generated method stub
		return anaDailyStatMapper.avgAnaDailyStat();
	}

	@Override
	public AnaDailyStatEntity maxAnaDailyStat() {
		// TODO Auto-generated method stub
		return anaDailyStatMapper.maxAnaDailyStat();
	}

}
